<script src="../../resources/testharness.js"></script>
<script src="../../resources/testharnessreport.js"></script>
<script>
test(function() {
    var patternCanvas = new OffscreenCanvas(0, 50);
    var patternCanvasCtx = patternCanvas.getContext("2d");
    patternCanvasCtx.fillStyle = '#fed';
    patternCanvasCtx.fillRect(0, 0, 15, 15);
    var myOCanvas = new OffscreenCanvas(100, 100);
    var myOCanvasCtx = myOCanvas.getContext("2d");
    assert_throws_dom("InvalidStateError", function() {
      myOCanvasCtx.createPattern(patternCanvas, 'repeat');
    });
}, "CreatePattern using OffcreenCanvas as image source throws exception when offscreenCanvas has zero size");
</script>
